/*
 * MenuClient.cpp
 *
 *  Created on: 28 mars 2012
 *      Author: alaa
 */

/*
 * Menu.cpp
 *
 *  Created on: 27 mars 2012
 *      Author: alaa
 */
//#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include "DaoClient.h"
#include "Client.h"
using namespace std ;


DaoClient C;


void Saisir_Client()
    		{long numClient;
    		long numPermis;
    		string nomClient;
    		string prenomClient;
    		string adresse;
    		string ville;
    		long telephone;

    			cout << endl << "Nouveau Client" << endl << endl;
    			cout << "numero de client: ";
    			cin >> numClient;

    			if( C.exist_Client(numClient) ){// methode a faire dans la classe Daoclient
    				cout << "Ce numero  existe deja" << endl;
    			}    else
    			{   cout<<" numClient:"<<endl;
    			    cin >> numClient;

    				cout << "numPermis : ";
    				cin >> numPermis;
    				cout << "nomClient : ";
    				cin >> nomClient;
    				cout << "prenomClient: ";
    				cin >> prenomClient;
    				cout << "adresse : ";
    				cin >> adresse;
    				cout << "ville : ";
    				cin >> ville;
    				cout << "tel: ";
    				cin >> telephone;

    				 Client c(numClient,numPermis,nomClient,prenomClient,adresse,ville,telephone);
    				 C.ajouterClient( c );


    			}
    		}









int main()
{

	int  option;,trouve;

char save;
long c;

	cout<<"\n\n\n\n\n\n\n"<<endl ;;
	cout<<"        **     *********  *********  **********  **   ******   **       **"<<endl;
	cout<<"      ******   *********  *********  **********  **  ********  ***      **"<<endl;
	cout<<"     ********  **         **             **      **  **    **  ****     **"<<endl;
	cout<<"    ***        **         **             **      **  **    **  ** **    **"<<endl;
	cout<<"    **         *********  *********      **      **  **    **  **  **   **"<<endl;
	cout<<"    **         *********  *********      **      **  **    **  **   **  **"<<endl;
	cout<<"    **    ***  **                **      **      **  **    **  **    ** **"<<endl;
	cout<<"    ***   ***  **                **      **      **  **    **  **     ****"<<endl;
	cout<<"     ********  *********  *********      **      **  ********  **      ***"<<endl;
	cout<<"      *****    *********  *********      **      **   ******   **       **"<<endl;
	cout<<"\n\n\n\n\n\n\n"<<endl;
	sleep(2500);
	system("cls");
	cout<<"\n\n\n\n\n\n\n"<<endl;
	cout<<"                             ********    *********                         "<<endl;
	cout<<"                             *********   *********                         "<<endl;
	cout<<"                             **     ***  **                                "<<endl;
	cout<<"                             **     ***  **                                "<<endl;
	cout<<"                             **     ***  *********                         "<<endl;
	cout<<"                             **     ***  *********                         "<<endl;
	cout<<"                             **     ***  **                                "<<endl;
	cout<<"     	                     **     ***  **                               "<<endl;
	cout<<"                             *********   *********                         "<<endl;
	cout<<"                             ********    *********                         "<<endl;
	cout<<"\n\n\n\n\n\n\n"<<endl;
	sleep(2500);
	system("cls");
	cout<<"\n\n\n\n\n\n\n"<<endl;
	cout<<"**         ******    *******   ********** ********  **   ******    **       ** "<<endl;
	cout<<"**        *********  *******   ********** ********  **  ********   ***      ** "<<endl;
	cout<<"**        **     **  **        **      **    **     **  **    **   ***      ** "<<endl;
	cout<<"**        **     **  **        **      **    **     **  **    **   ** **    ** "<<endl;
	cout<<"**        **     **  **        **********    **     **  **    **   **  **   ** "<<endl;
	cout<<"**        **     **  **        **      **    **     **  **    **   **   **  ** "<<endl;
	cout<<"**        **     **  **        **      **    **     **  **    **   **    ** ** "<<endl;
	cout<<"**        **     **  **        **      **    **     **  **    **   **     **** "<<endl;
	cout<<"******    *********  ******    **      **    **     **  ********   **      *** "<<endl;
	cout<<"******     *******   *******   **      **    **     **   ******    **       ** "<<endl;
	cout<<"\n\n\n\n\n\n\n"<<endl;
	sleep(2500);
system("cls");

system("COLOR 1E");

cout<<"\n\n\n\n                 GESTION LOCATION DE VOITURE V2.1\n\n"<<endl;cout<<"\n\n"<<endl;
	for(int s=0;s<80;s++)
			putchar(260);
	cout<<"\n"<<endl;
		cout<<"                      ________________                           "<<endl;
		cout<<"                    /                  --<---<---<--             "<<endl;
					cout<<"             _ ___/                     --<---<---<--            "<<endl;
		cout<<"            |__ __                  ______ --<---<---<--         "<<endl;
		cout<<"                  (__)----------(__)                             "<<endl;
		for(int z=0;z<80;z++)
			putchar(260);cout<<"\n\n"<<endl;
			cout<<"                       developpee par:Tactcpp2                     \n\n\n"<<endl;


			cout<<"\n\n\n\tChargement"<<endl;
	for(int i=1;i<36;i++)
	{

		sleep(200);//attente
		cout<<".";

	}system("cls");
	do
{system("COLOR 1e");
	cout<<"\n"<<endl;
	cout<<"\n\n\n\t\t\t GESTION LOCATION DE VOITURE V2.1\n\n"<<endl;
	do
	 {string Login;
	 string Password;
	 int x;
	 Siege S;
	cout<<"BIENVENU:   Vous devez entrer votre login & mot de passe :"<<endl;
	cout<< "Votre login : "<<endl;
	cin>>Login;
	cout<< "Votre mot de passe : "<<endl;
	cin>>Password;
	S.IdentifierAgent(Login, Password);//methode a refaire la classe siege
	 } while((S.IdentifierAgent( Login, Password))==true);
	do{
			do


		cout<<"      ��������������������������MENU����������������������������ͻ"<<endl;
		cout<<"      �   -----------------------------------------------------  �"<<endl;
		cout<<"      �  (  | 1 | Ajouter Client                               ) �"<<endl;
		cout<<"      �                                                          �"<<endl;
		cout<<"      �  (  | 2 | Afficher les Clients                         ) �"<<endl;
		cout<<"      �                                                          �"<<endl;
		cout<<"      �                                                          �"<<endl;
		cout<<"      �  (  | 0 | EXIT                                         ) �"<<endl;
		cout<<"      �   -----------------------------------------------------  �"<<endl;
		cout<<"      ����������������������������������������������������������ͼ"<<endl;

		cout<<"      *        Entrer Votre Choix                    *\t"<<endl;
    cin>>option;
    while(option != 0)
    	{
    		switch(option)
    		{
    			case 1:
    				Saisir_Client();
    				break;


    			case 2:
    				C.listClient() ;
    				break;


    			default:
    				cout << "Option non disponible" << "\a" << endl;
    		};













